package com.wangjiyuan.giftshuo.http;

import com.wangjiyuan.giftshuo.bean.detail.DetailBean;
import com.wangjiyuan.giftshuo.bean.home.banners.ADBean;
import com.wangjiyuan.giftshuo.bean.home.column.HomeBean;
import com.wangjiyuan.giftshuo.bean.home.preset.PresetBean;
import com.wangjiyuan.giftshuo.bean.home.secondarybanners.SecondaryBanners;
import com.wangjiyuan.giftshuo.bean.more.MoreBean;
import com.wangjiyuan.giftshuo.bean.search.HotBean;
import com.wangjiyuan.giftshuo.bean.update.VersionBean;
import com.wangjiyuan.giftshuo.config.home.UrlConfig;

import java.util.Map;

import retrofit2.http.GET;
import retrofit2.http.Path;
import retrofit2.http.QueryMap;
import retrofit2.http.Url;
import rx.Observable;

/**
 * Created by wjy on 2016/11/15.
 */

public interface HttpInterfaces {
    /**
     * 用于获取首页的信息
     *
     * @param path 不同栏目有不同的path
     * @param map  要传递的参数
     * @return
     */
    @GET(UrlConfig.PATH_LIST)
    Observable<HomeBean> getHomeBean(@Path("path") String path, @QueryMap Map<String, String> map);

    @GET(UrlConfig.PATH_PRESET)
    Observable<PresetBean> getPreset(@QueryMap Map<String, String> map);

    @GET(UrlConfig.PATH_MORE)
    Observable<MoreBean> getMoreBean(@Path("id") String id, @QueryMap Map<String, String> map);

    /**
     * 获取广告的信息
     *
     * @return
     */
    @GET(UrlConfig.PATH_AD)
    Observable<ADBean> getADBean();

    /**
     * 获取secondary信息
     *
     * @return
     */
    @GET(UrlConfig.PATH_SECONDARY)
    Observable<SecondaryBanners> getSecondaryBean(@QueryMap Map<String, String> map);

    /**
     * 获取热词的信息
     *
     * @return
     */
    @GET(UrlConfig.PATH_HOT_WORD)
    Observable<HotBean> getHotBean();

    @GET(UrlConfig.PATH_DETAIL)
    Observable<DetailBean> getData(@Path("id") String id);

    @GET()
    Observable<VersionBean> VersionCheck(@Url String s);
}
